<?
include ('header.php');

?>


<div class="block medium right">
			<div class="top">	
                  <h1>Transfer Coins</h1>
            </div>
			<div class="content">
			<div class="infobox">
			<center>



<?

$date=date("m/d/y");

$user=$data['login'];

$trans1 = $data['coins']-$_POST[coins];



$result = mysql_query("SELECT * FROM users where login='$_POST[member]' ") 
or die(mysql_error());  


while($row = mysql_fetch_array( $result )) {

	// Print out the contents of each row into a table
$rmem = $row['login'];
$trans2 = $row['coins'] + $_POST[coins];
}
 

	
mysql_query("INSERT INTO trans VALUES('','$rmem','$user', '$_POST[coins]','$date' ) ") 
or die(mysql_error()); 

$userlogin = $data['login'];
mysql_query("UPDATE users SET coins='$trans1' WHERE login='{$data['login']}'") 
or die(mysql_error()); 

mysql_query("UPDATE users SET coins='$trans2' WHERE login='$rmem' ") 
or die(mysql_error()); 




?>


<meta http-equiv="refresh" content="0;url=transfer.php"> 



<BR><BR>

</div>
</div>
</div>

<?
include ('footer.php'); ?>






 